package com.example.demo.excel.util;

/**
 * @author zjq
 * @version 创建时间：2021-12-20 11:19:23
 */


public class BaseException extends RuntimeException {

    /**
     *
     */
    private static final long serialVersionUID = 1L;

    private int code = 1;

    public BaseException(String message) {
        super(message);
    }

    public BaseException(String message, Throwable e) {
        super(message, e);
    }

    public BaseException(int code, String message) {
        super(message);
        this.code = code;
    }

    public BaseException(int code, String message, Throwable e) {
        super(message, e);
        this.code = code;
    }

    public BaseException(ResultStatus status) {
        super(status.getMessage());
        this.code = status.getCode();
    }

    public int getCode() {
        return code;
    }


    public void setCode(int code) {
        this.code = code;
    }

    @Override
    public String toString() {
        return "BaseException [code=" + code + "," + super.getMessage() + "]";
    }


}
